import React, { Component, PureComponent } from 'react'

class App extends Component {
  render() {
    return (
      <div>
        App name: {this.props.name}
      </div>
    )
  }
}

// 定义组件名称
// App.displayName = "yz"

function enhanceComponent(WrappedComponent) {
  class NewComponent extends PureComponent {
    render() {
      return <WrappedComponent {...this.props}/>
    }
  }

  NewComponent.displayName = "yzz"
  return NewComponent
}

function enhanceComponent2(WrappedComponent) {
  function NewComponent(props) {
    return <WrappedComponent {...props}/>
  }

  NewComponent.displayName = "en2"
  return NewComponent
}

const EnhanceComponent = enhanceComponent2(App)

export default EnhanceComponent;
